# -*- coding: utf-8 -*-



from PyQt4 import QtCore, QtGui
from compiler.pycodegen import VERSION
import sys
from fonk import VERSION, byte


class MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.resize(500, 400)
        MainWindow.setMinimumSize(500,400)
        self.cw = QtGui.QWidget(MainWindow)
        self.gridLayout = QtGui.QGridLayout(self.cw)
        self.treeWidget = QtGui.QTreeWidget(self.cw)
        item_0 = QtGui.QTreeWidgetItem(self.treeWidget)
        #item_0.setIcon(0, QtGui.QTreeWidget.Checked)
        self.gridLayout.addWidget(self.treeWidget, 0, 0, 2, 2)
        MainWindow.setCentralWidget(self.cw)
        self.menubar = QtGui.QMenuBar(MainWindow)
        #self.menubar.setGeometry(QtCore.QRect(0, 0, 500, 19))
        self.mDosya = QtGui.QMenu(self.menubar)
        self.mYardim = QtGui.QMenu(self.menubar)
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(MainWindow)
        MainWindow.setStatusBar(self.statusbar)
        self.toolBar = QtGui.QToolBar(MainWindow)
        MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar)
        self.aKullanimKlavuzu = QtGui.QAction(MainWindow)
        self.aHakkinda = QtGui.QAction(MainWindow)
        self.aQtHakkinda = QtGui.QAction(MainWindow)
        self.aKapat = QtGui.QAction(MainWindow)
        self.aYukle = QtGui.QAction(MainWindow)
        self.aPDZAc = QtGui.QAction(MainWindow)
        self.mDosya.addAction(self.aPDZAc)
        self.mDosya.addSeparator()
        self.mDosya.addAction(self.aKapat)
        self.mYardim.addAction(self.aKullanimKlavuzu)
        self.mYardim.addSeparator()
        self.mYardim.addAction(self.aHakkinda)
        self.mYardim.addAction(self.aQtHakkinda)
        self.menubar.addAction(self.mDosya.menuAction())
        self.menubar.addAction(self.mYardim.menuAction())
        self.toolBar.addAction(self.aPDZAc)
        self.toolBar.addAction(self.aYukle)
        self.toolBar.addAction(self.aKapat)

        self.retranslateUi(MainWindow)
        QtCore.QObject.connect(self.aHakkinda, QtCore.SIGNAL("triggered(bool)"), self.getHakkinda)
        QtCore.QObject.connect(self.aKapat, QtCore.SIGNAL("triggered(bool)"), MainWindow.close)
        QtCore.QObject.connect(self.aKullanimKlavuzu, QtCore.SIGNAL("triggered(bool)"), self.getKlavuz)
        QtCore.QObject.connect(self.aPDZAc, QtCore.SIGNAL("triggered(bool)"), self.getPDZ)
        QtCore.QObject.connect(self.aQtHakkinda, QtCore.SIGNAL("triggered(bool)"), QtGui.QApplication.aboutQt)
        QtCore.QObject.connect(self.aYukle, QtCore.SIGNAL("triggered(bool)"), self.install)
        QtCore.QObject.connect(self.statusbar, QtCore.SIGNAL("messageChanged(QString)"), self.sMessage)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def getHakkinda(self):
        mesaj = u"""<html>
        Lisans: GPL v3<br>
        Sürüm: %s<br>
        <b>ODUN</b> © 2010<br>
        <b>Kodlayanlar:</b><br>
        Aşkın Yollu   - <a href="mailto:askin@askin.ws">askin@askin.ws</a><br>
        Erdem Artan   - <a href="mailto:badibere@gmail.com">badibere@gmail.com</a><br>
        Metehan Özbek - <a href="mailto:metehan@istanbul.com">metehan@istanbul.com</a><br>
        <br>Proje Sayfası: 
        <a href='http://code.google.com/p/pisidown'>http://code.google.com/p/pisidown</a>
        </html>
        """%VERSION
        mesajk = QtGui.QMessageBox.about(self.cw, u"ODUN Hakkında", mesaj)
    
    def getKlavuz(self):
        pass
    
    def getPDZ(self):
        pass
    
    def sMessage(self):
        pass
    
    def install(self):
        pass

    def retranslateUi(self, MainWindow):
        MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "ODUN - Installer", None, QtGui.QApplication.UnicodeUTF8))
        self.treeWidget.headerItem().setText(0, QtGui.QApplication.translate("MainWindow", "Paket", None, QtGui.QApplication.UnicodeUTF8))
        self.treeWidget.headerItem().setText(1, QtGui.QApplication.translate("MainWindow", "Boyut", None, QtGui.QApplication.UnicodeUTF8))
        self.treeWidget.headerItem().setText(2, QtGui.QApplication.translate("MainWindow", "Açıklama", None, QtGui.QApplication.UnicodeUTF8))
        __sortingEnabled = self.treeWidget.isSortingEnabled()
        self.treeWidget.setSortingEnabled(False)
        self.treeWidget.topLevelItem(0).setText(0, QtGui.QApplication.translate("MainWindow", "Python", None, QtGui.QApplication.UnicodeUTF8))
        self.treeWidget.topLevelItem(0).setText(1, QtGui.QApplication.translate("MainWindow", "12mb", None, QtGui.QApplication.UnicodeUTF8))
        self.treeWidget.topLevelItem(0).setText(2, QtGui.QApplication.translate("MainWindow", "asdasd", None, QtGui.QApplication.UnicodeUTF8))
        self.treeWidget.setSortingEnabled(__sortingEnabled)
        self.mDosya.setTitle(QtGui.QApplication.translate("MainWindow", "Dosya", None, QtGui.QApplication.UnicodeUTF8))
        self.mYardim.setTitle(QtGui.QApplication.translate("MainWindow", "Yardım", None, QtGui.QApplication.UnicodeUTF8))
        self.toolBar.setWindowTitle(QtGui.QApplication.translate("MainWindow", "toolBar", None, QtGui.QApplication.UnicodeUTF8))
        self.aKullanimKlavuzu.setText(QtGui.QApplication.translate("MainWindow", "Kullanım Klavuzu", None, QtGui.QApplication.UnicodeUTF8))
        self.aHakkinda.setText(QtGui.QApplication.translate("MainWindow", "Hakkında", None, QtGui.QApplication.UnicodeUTF8))
        self.aQtHakkinda.setText(QtGui.QApplication.translate("MainWindow", "Qt Hakkında", None, QtGui.QApplication.UnicodeUTF8))
        self.aKapat.setText(QtGui.QApplication.translate("MainWindow", "Kapat", None, QtGui.QApplication.UnicodeUTF8))
        self.aYukle.setText(QtGui.QApplication.translate("MainWindow", "Yükle", None, QtGui.QApplication.UnicodeUTF8))
        self.aPDZAc.setText(QtGui.QApplication.translate("MainWindow", "PDZ Aç", None, QtGui.QApplication.UnicodeUTF8))

if __name__ == "__main__":
    app = QtGui.QApplication(sys.argv)
    window = QtGui.QMainWindow()
    ui = MainWindow()
    ui.setupUi(window)
    window.show()
    sys.exit(app.exec_())
